## Using the Sound Driver-Summary

(1) First do the following declaration.

            #include <AgbSound.h>
            #include <AgbSystemCall.h>
            SoundArea sndwrk; // Work Area (the variable name sndwrk is arbitrary)

(2) Execute the following with the initialization routine after reset.
This carries out the sound related I/O initialization, set aside of work area, etc.

            SoundDriverInit(&sndwrk);

(3) Call the following function immediately following each V blank interrupt.
The timing is very critical here so ideally you should call it before any other processing.
The processing itself is extremely short.

            SoundDriverVSync();

(4) Call the following function during each V sync(every 1/60 second).
There is no need to be concerned about the timing. It is fine to call this after all
processing other than that for other songs is done.

            SoundDriverMain();

(5) If the preceding functions have been called, if you set an appropriate value for the
virtual channel, sa.vchn[x], AGB direct sound can be produced.
Refer to "Explanation of Virtual Channel Structure 'SoundChannel'"
which follows for more detail.

[ | Back | Programmer's Manual Table of Contents | Using AGB Direct Sound Driver Table of Contents | Next | ]